import request from '@/utils/request'

// 查询任务主列表
export function taskList(query) {
  return request({
    url: '/spider/spiderMission/list',
    method: 'post',
    params: query
  })
}

// 修改任务主
export function updateTask(query) {
  return request({
    url: '/spider/spiderMission/edit',
    method: 'post',
    params: query
  })
}

// 新增任务主
export function addTask(query) {
  return request({
    url: '/spider/spiderMission/add',
    method: 'post',
    params: query
  })
}

// 启动任务主
export function startTask(data) {
  return request({
    url: '/spider/spiderMission/runSpiderMission/' + data.missionId,
    method: 'post',
    data: data
  })
}

// 配置列表
export function configTask(query) {
  return request({
    url: '/spider/spiderConfig/list',
    method: 'post',
    params: query
  })
}

// 删除任务
export function delTask(query) {
  return request({
    url: '/spider/spiderMission/remove',
    method: 'post',
    params: query
  })
}

// 导出任务主
export function exportTask(query) {
  return request({
    url: '/spider/spiderMission/export',
    method: 'post',
    params: query
  })
}

export function getTask(query) {
  return request({
    url: '/actuator/jolokia/list?canonicalNaming=false',
    method: 'get',
    params: query
  })
}
//
